class TrainDataEntity {
  List<TrainEntity>? data;

  TrainDataEntity({this.data});

  factory TrainDataEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['data'] as List;
    List<TrainEntity> protocolList =
        originList.map((value) => TrainEntity.fromJson(value)).toList();
    return TrainDataEntity(data: protocolList);
  }
}

class TrainEntity {
  final String? trainingTypeName;
  final String? trainingType;
  List<TrainInfo>? trainingList;

  TrainEntity({this.trainingList, this.trainingTypeName, this.trainingType});

  factory TrainEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['trainingList'] as List;
    List<TrainInfo> protocolList =
        originList.map((value) => TrainInfo.fromJson(value)).toList();
    return TrainEntity(
        trainingList: protocolList,
        trainingTypeName: json['trainingTypeName'],
        trainingType: json['trainingType']);
  }
}

class TrainListEntity {
  List<TrainInfo>? rows;

  TrainListEntity({
    this.rows,
  });

  factory TrainListEntity.fromJson(Map<String, dynamic> json) {
    final originList = json['rows'] as List;
    List<TrainInfo> protocolList =
        originList.map((value) => TrainInfo.fromJson(value)).toList();
    return TrainListEntity(
      rows: protocolList,
    );
  }
}

class TrainInfo {
  String? name;
  String? detail;
  String? mainPicPath;
  int? id;
  int? attachId;
  String? profile;
  String? content;
  String? createdDate;
  // bool isSelected;

  TrainInfo({
    this.name,
    this.detail,
    this.mainPicPath,
    this.id,
    this.content,
    this.createdDate,
    this.attachId,
    this.profile,
  });

  TrainInfo.fromJson(Map data) {
    name = data['name'];
    detail = data['detail'];
    mainPicPath = data['mainPicPath'];
    id = data['id'];
    content = data['content'];
    createdDate = data['createdDate'];
    attachId = data['attachId'];
    profile = data['profile'];
  }
}

class TrainDtailInfo {
  String? title;
  String? instructions;
  String? mainPicPath;
  String? id;
  String? content;
  String? createdDate;
  // bool isSelected;

  TrainDtailInfo({
    this.title,
    this.instructions,
    this.mainPicPath,
    this.id,
    this.content,
    this.createdDate,
    // this.org
  });

  TrainDtailInfo.fromJson(Map data) {
    title = data['title'];
    instructions = data['instructions'];
    mainPicPath = data['mainPicPath'];
    id = data['id'];
    content = data['content'];
    createdDate = data['createdDate'];
    // isSelected = data['isSelected'] = false;
  }
}
